x86/xsave: fix nonlazy state handling
authorLiu Jinsong <jinsong.liu@intel.com>
Mon, 25 Nov 2013 10:19:04 +0000 (11:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 25 Nov 2013 10:19:04 +0000 (11:19 +0100)
commit7d8b5dd98463524686bdee8b973b53c00c232122
tree496c98c68e1bc24c8174f668c6c72b96bf6d5927
parent0774c003adc4e23a68487eeb46ccd05d445559e8
x86/xsave: fix nonlazy state handling

Nonlazy xstates should be xsaved each time when vcpu_save_fpu.
Operation to nonlazy xstates will not trigger #NM exception, so
whenever vcpu scheduled in it got restored and whenever scheduled
out it should get saved.

Currently this bug affects AMD LWP feature, and later Intel MPX
feature. With the bugfix both LWP and MPX will work fine.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Furthermore, during restore we also need to set nonlazy_xstate_used
according to the incoming accumulated XCR0.

Also adjust the changes to i387.c such that there won't be a pointless
clts()/stts() pair.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domctl.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/i387.c